import Vue from 'vue'
import Router from 'vue-router'

Vue.use(Router)

/* Layout */
import Layout from '@/layout'

/**
 * Note: sub-menu only appear when route children.length >= 1
 * Detail see: https://panjiachen.github.io/vue-element-admin-site/guide/essentials/router-and-nav.html
 *
 * hidden: true                   if set true, item will not show in the sidebar(default is false)
 * alwaysShow: true               if set true, will always show the root menu
 *                                if not set alwaysShow, when item has more than one children route,
 *                                it will becomes nested mode, otherwise not show the root menu
 * redirect: noRedirect           if set noRedirect will no redirect in the breadcrumb
 * name:'router-name'             the name is used by <keep-alive> (must set!!!)
 * meta : {
    roles: ['admin','editor']    control the page roles (you can set multiple roles)
    title: 'title'               the name show in sidebar and breadcrumb (recommend set)
    icon: 'svg-name'/'el-icon-x' the icon show in the sidebar
    breadcrumb: false            if set false, the item will hidden in breadcrumb(default is true)
    activeMenu: '/example/list'  if set path, the sidebar will highlight the path you set
  }
 */

/**
 * constantRoutes
 * a base page that does not have permission requirements
 * all roles can be accessed
 */
export const constantRoutes = [
    {
        path: '/',
        component: () => import('@/views/login/index'),
        hidden: true,
    },
    {
        path: '/preview',
        name: 'previewFiles',
        component: () => import('@/views/preview/index'),
        hidden: true,
    },

    // {
    //   path: '/404',
    //   component: () => import('@/views/404'),
    //   hidden: true
    // },

    // 404 page must be placed at the end !!!
    //{ path: '*', redirect: '/404', hidden: true }
]

// 异步加载的路由
export const asynRouter = [
    {
        path: '/main',
        component: Layout,
        redirect: '/main',
        meta: { title: '概览', icon: 'home', menuNo: 101 },
        children: [
            {
                path: '/main/sale',
                name: 'salePreview',
                component: () => import('@/views/main/sale'),
                meta: {
                    title: '销售概览',
                    icon: 'dashboard',
                    menuNo: 10102,
                    parentId: 101,
                },
            },
            {
                path: '/main/index',
                name: 'index',
                component: () => import('@/views/main/index'),
                meta: {
                    title: '业务概览',
                    icon: 'dashboard',
                    menuNo: 10101,
                    parentId: 101,
                },
            },
            {
                path: '/main/city',
                name: 'cityPreview',
                component: () => import('@/views/main/city'),
                meta: {
                    title: '城市概览',
                    icon: 'dashboard',
                    menuNo: 10105,
                    parentId: 101,
                },
            },
            {
                path: '/main/hospital',
                name: 'hospitalPreview',
                component: () => import('@/views/main/hospital'),
                meta: {
                    title: '医院概览',
                    icon: 'dashboard',
                    menuNo: 10103,
                    parentId: 101,
                },
            },
            {
                path: '/main/daily',
                name: 'dailyPreview',
                component: () => import('@/views/main/daily'),
                meta: {
                    title: '日报表',
                    icon: 'dashboard',
                    menuNo: 10104,
                    parentId: 101,
                },
            },
        ],
    },
    {
        path: '/clues',
        component: Layout,
        name: 'clues',
        meta: { title: '线索', icon: 'clues', menuNo: 408 },
        // component:() => import('@/views/information/index'),
        children: [
            {
                path: '/clues/index',
                name: 'clues',
                component: () => import('@/views/clues/index'),
                redirect: '/clues/activityList',
                meta: { title: '活动管理', icon: 'form', menuNo: 40801, parentId: 408 },
                children: [
                    {
                        path: '/clues/activityList',
                        name: 'activityList',
                        component: () => import('@/views/clues/activityList'),
                        hidden: true,
                        meta: {
                            title: '活动管理',
                            // menuNo: 4080101,
                            // parentId: 40801,
                            menuNo: 40801,
                            parentId: 408,
                        },
                    },
                    {
                        path: '/clues/add',
                        name: 'addActivity',
                        hidden: true,
                        component: () => import('@/views/clues/add'),
                        meta: {
                            title: '新增活动',
                            // menuNo: 4080102,
                            // parentId: 40801,
                        },
                    },
                ],
            },
            {
                path: '/cluesList',
                name: 'cluesList',
                component: () => import('@/views/clues/cluesList'),
                meta: { title: '线索管理', icon: 'form', menuNo: 40802, parentId: 408 },
            },
            {
                path: '/distributedList',
                name: 'distributedList',
                component: () => import('@/views/clues/distributedList'),
                meta: { title: '待分配线索', icon: 'form', menuNo: 40803, parentId: 408 },
            },
            {
                path: '/distributionRules',
                name: 'distributionRules',
                component: () => import('@/views/clues/distributionRules'),
                meta: { title: '分配规则', icon: 'form', menuNo: 40804, parentId: 408 },
            },
            {
                path: '/statistical',
                name: 'statistical',
                component: () => import('@/views/clues/statistical'),
                meta: { title: '分配统计', icon: 'form', menuNo: 40805, parentId: 408 },
            },
        ],
    },
    {
        path: '/customer',
        component: Layout,
        name: 'customer',
        meta: { title: '客户', icon: 'customer', menuNo: 102 },
        children: [
            {
                path: '/customer/index',
                name: 'customerAll',
                component: () => import('@/views/customer/index'),
                meta: {
                    title: '所有客户',
                    icon: 'table',
                    menuNo: 10201,
                    parentId: 102,
                },
            },
            {
                path: '/customer/today',
                name: 'customerToday',
                component: () => import('@/views/customer/today'),
                meta: {
                    title: '今日待跟进',
                    icon: 'tree',
                    menuNo: 10211,
                    parentId: 102,
                },
            },
            {
                path: '/customer/contact',
                name: 'customerContact',
                component: () => import('@/views/customer/contact'),
                meta: {
                    title: '待联系客户',
                    icon: 'tree',
                    menuNo: 10202,
                    parentId: 102,
                },
            },
            {
                path: '/customer/star',
                name: 'customerStar',
                component: () => import('@/views/customer/star'),
                meta: {
                    title: '星标客户',
                    icon: 'tree',
                    menuNo: 10210,
                    parentId: 102,
                },
            },
            {
                path: '/customer/book',
                name: 'customerBook',
                component: () => import('@/views/customer/book'),
                meta: {
                    title: '待预约客户',
                    icon: 'tree',
                    menuNo: 10203,
                    parentId: 102,
                },
            },
            {
                path: '/customer/booked',
                name: 'customerBooked',
                component: () => import('@/views/customer/booked'),
                meta: {
                    title: '已预约客户',
                    icon: 'tree',
                    menuNo: 10204,
                    parentId: 102,
                },
            },
            {
                path: '/customer/traded',
                name: 'customerTraded',
                component: () => import('@/views/customer/traded'),
                meta: {
                    title: '已成交客户',
                    icon: 'tree',
                    menuNo: 10205,
                    parentId: 102,
                },
            },
            {
                path: '/customer/unsettled',
                name: 'customerUnsettled',
                component: () => import('@/views/customer/unsettled'),
                meta: {
                    title: '未成交客户',
                    icon: 'tree',
                    menuNo: 10206,
                    parentId: 102,
                },
            },
            {
                path: '/customer/invalid',
                name: 'customerInvalid',
                component: () => import('@/views/customer/invalidCustomer'),
                meta: {
                    title: '无效客户',
                    icon: 'tree',
                    menuNo: 10208,
                    parentId: 102,
                },
            },
            {
                path: '/customer/loss',
                name: 'customerLoss',
                component: () => import('@/views/customer/lossCustomer'),
                meta: {
                    title: '流失客户',
                    icon: 'tree',
                    menuNo: 10207,
                    parentId: 102,
                },
            },
            {
                path: '/customer/sea',
                name: 'customerSea',
                component: () => import('@/views/customer/seaCustomer'),
                meta: {
                    title: '公海客户',
                    icon: 'tree',
                    menuNo: 10209,
                    parentId: 102,
                },
            },
        ],
    },
    {
        path: '/book',
        component: Layout,
        name: 'book',
        meta: { title: '预约', icon: 'book', menuNo: 103 },
        children: [
            {
                path: '/book/index',
                name: 'bookIndex',
                component: () => import('@/views/book/index'),
                meta: { title: '所有预约', icon: 'form', menuNo: 10301, parentId: 103 },
            },
            {
                path: '/book/undue',
                name: 'bookUndue',
                component: () => import('@/views/book/undue'),
                //meta: { title: '未到期', icon: 'form', menuNo: 10302, parentId: 103 },
                meta: { title: '待提醒', icon: 'form', menuNo: 10302, parentId: 103 },
            },
            {
                path: '/book/expired',
                name: 'bookeExpired',
                component: () => import('@/views/book/expired'),
                //meta: { title: '已到期', icon: 'form', menuNo: 10303, parentId: 103 },
                meta: { title: '待更新', icon: 'form', menuNo: 10303, parentId: 103 },
            },
            {
                path: '/book/visit',
                name: 'bookVisit',
                component: () => import('@/views/book/visit'),
                meta: { title: '待回访', icon: 'form', menuNo: 10304, parentId: 103 },
            },
            {
                path: '/book/hospital',
                name: 'bookHospital',
                component: () => import('@/views/book/hospital_feedback'),
                meta: { title: '医院反馈', icon: 'form', menuNo: 10305, parentId: 103 },
            },
            {
                path: '/book/hospital/record',
                name: 'bookHospitalReacord',
                component: () => import('@/views/book/feedback_record'),
                meta: { title: '反馈记录', icon: 'form', menuNo: 10306, parentId: 103 },
            },
        ],
    },
    {
        path: '/deal',
        component: Layout,
        meta: { title: '成交', icon: 'deal', menuNo: 104 },
        children: [
            {
                path: '/deal/record',
                name: 'dealRecord',
                component: () => import('@/views/deal/index'),
                meta: { title: '成交记录', icon: 'form', menuNo: 10401, parentId: 104 },
            },
            {
                path: '/deal/payment',
                name: 'dealPayment',
                component: () => import('@/views/deal/payment'),
                meta: { title: '收款记录', icon: 'form', menuNo: 10402, parentId: 104 },
            },
            {
                path: '/deal/results',
                name: 'dealResults',
                component: () => import('@/views/deal/results'),
                meta: { title: '业绩核算', icon: 'form', menuNo: 10403, parentId: 104 },
            },
        ],
    },
    {
        path: '/scheduling',
        component: Layout,
        name: 'scheduling',
        meta: { title: '排班', icon: 'scheduling', menuNo: 105 },
        children: [
            {
                path: '/scheduling/index',
                name: 'schedulingIndex',
                component: () => import('@/views/scheduling/index'),
                meta: { title: '排班', icon: 'form', menuNo: 10501, parentId: 105 },
            },
        ],
    },
    {
        path: '/hospital',
        component: Layout,
        name: 'hospital',
        meta: { title: '医院', icon: 'hospital', menuNo: 106 },
        // component:() => import('@/views/information/index'),
        children: [
            {
                path: '/hospital/all',
                name: 'allHospital',
                component: () => import('@/views/hospital/index'),
                meta: {
                    title: '所有医院',
                    menuNo: 10605,
                    parentId: 106,
                },
                redirect: '/hospital/all/list',
                children: [
                    {
                        path: '/hospital/all/list',
                        name: 'allHospitalList',
                        component: () => import('@/views/hospital/allList'),
                        //redirect: '/hospital/list',
                        meta: {
                            title: '所有医院',
                            menuNo: 10605,
                            parentId: 106,
                        },
                        hidden: true
                    },
                    {
                        path: '/hospital/all/add',
                        name: 'allHospitalAdd',
                        hidden: true,
                        component: () => import('@/views/hospital/addHospital'),
                        meta: {
                            title: '新增医院',
                            // menuNo: 1060502,
                            // parentId: 10605,
                        },
                    },
                    {
                        path: '/hospital/all/static',
                        name: 'hospitalAllStatic',
                        component: () => import('@/views/hospital/static'),
                        meta: {
                            title: '数据分析',
                            // menuNo: 1060501,
                            // parentId: 10605,
                        },
                        hidden: true,
                    },
                ]
            },
            {
                path: '/hospital/index',
                name: 'hospital',
                component: () => import('@/views/hospital/index'),
                redirect: '/hospital/list',
                meta: { title: '预约医院', icon: 'form', menuNo: 10608, parentId: 106 },
                children: [
                    {
                        path: '/hospital/list',
                        name: 'hospital',
                        component: () => import('@/views/hospital/list'),
                        meta: {
                            title: '预约医院',
                            menuNo: 10608,
                            parentId: 106,
                        },
                    },
                    {
                        path: '/hospital/add',
                        name: 'hospitalAdd',
                        hidden: true,
                        component: () => import('@/views/hospital/addHospital'),
                        meta: {
                            title: '新增医院',
                            // menuNo: 1060502,
                            // parentId: 10605,
                        },
                    },
                    // {
                    //     path: '/hospital/add',
                    //     name: 'addHospital',
                    //     hidden: true,
                    //     component: () => import('@/views/hospital/addHospital'),
                    //     meta: {
                    //         title: '新增医院',
                    //         menuNo: 1060102,
                    //         parentId: 10601,
                    //     },
                    // },
                    // {
                    //     path: '/hospital/static',
                    //     name: 'hospitalStatic',
                    //     component: () => import('@/views/hospital/static'),
                    //     meta: {
                    //         title: '数据分析',
                    //         menuNo: 1060103,
                    //         parentId: 10601,
                    //     },
                    // },
                ],
            },
            {
                path: '/doctor/all',
                name: 'allDoctor',
                component: () => import('@/views/doctor/index'),
                meta: {
                    title: '所有医生',
                    menuNo: 10606,
                    parentId: 106,
                },
                redirect: '/doctor/all/list',
                children: [
                    {
                        path: '/doctor/all/list',
                        name: 'allDoctorList',
                        component: () => import('@/views/doctor/allList'),
                        //redirect: '/hospital/list',
                        meta: {
                            title: '所有医生',
                            menuNo: 10606,
                            parentId: 106,
                        },
                    },
                    {
                        path: '/doctor/all/add',
                        name: 'allDoctorAdd',
                        hidden: true,
                        component: () => import('@/views/doctor/addDoctor'),
                        meta: {
                            title: '新增医生',
                            // menuNo: 1060202,
                            // parentId: 10602,
                        },
                    },
                ]
            },
            {
                path: '/doctor',
                name: 'hospitalDoctorIndex',
                component: () => import('@/views/doctor/index'),
                redirect: '/doctor/list',
                meta: { title: '预约医生', icon: 'form', menuNo: 10607, parentId: 106 },
                children: [
                    {
                        path: '/doctor/list',
                        name: 'hospitalDoctor',
                        component: () => import('@/views/doctor/list'),
                        meta: {
                            title: '预约医生',
                            icon: 'form',
                            menuNo: 10607,
                            parentId: 106,
                        },
                    },
                    {
                        path: '/doctor/add',
                        name: 'addDoctor',
                        hidden: true,
                        component: () => import('@/views/doctor/addDoctor'),
                        meta: {
                            title: '新增医生',
                            icon: 'form',
                        },
                    },
                ],
            },
            {
                path: '/goods',
                name: 'hospitalGoodsIndex',
                component: () => import('@/views/goods/index'),
                meta: { title: '商品管理', icon: 'form', menuNo: 10609, parentId: 106 },
                redirect: '/goods/list',
                children: [
                    {
                        path: '/goods/list',
                        name: 'hospitalGoodsList',
                        component: () => import('@/views/goods/list'),
                        meta: {
                            title: '商品管理',
                            icon: 'form',
                        },
                        hidden: true
                    },
                    {
                        path: '/goods/add',
                        name: 'hospitalGoodsAdd',
                        component: () => import('@/views/goods/add'),
                        meta: {
                            title: '新增商品',
                            icon: 'form',
                        },
                        hidden: true
                    },
                ]
            },
            {
                path: '/hospital/acount',
                name: 'hospitalAcount',
                component: () => import('@/views/hospital/acount'),
                meta: { title: '账号管理', icon: 'form', menuNo: 10603, parentId: 106 },
            },
            {
                path: '/hospital/log',
                name: 'hospitalLog',
                component: () => import('@/views/hospital/log'),
                meta: { title: '日志管理', icon: 'form', menuNo: 10604, parentId: 106 },
            }
        ],
    },
    {

        path: '/report',
        component: Layout,
        name: 'report',
        meta: { title: '报告', icon: 'report', menuNo: 208 },
        children: [
            {
                path: '/report/index',
                name: 'reportIndex',
                component: () => import('@/views/report/index'),
                meta: { title: '口腔报告', icon: 'form', menuNo: 20801, parentId: 208 },
                redirect: '/report/list',
                children: [
                    {
                        path: '/report/list',
                        name: 'reportList',
                        component: () => import('@/views/report/reportList'),
                        meta: { title: '口腔报告', icon: 'form', menuNo: 20801, parentId: 20801 },
                    },
                    {
                        path: '/report/add',
                        name: 'reportAdd',
                        hidden: true,
                        component: () => import('@/views/report/reportAdd'),
                        meta: { title: '新增口腔报告', icon: 'form' },
                    },
                ]
            },
            {
                path: '/report/question',
                name: 'questionIndex',
                component: () => import('@/views/report/index'),
                meta: { title: '口腔问题', icon: 'form', menuNo: 20802, parentId: 208 },
                redirect: '/report/question/list',
                children: [
                    {
                        path: '/report/question/list',
                        name: 'questionList',
                        component: () => import('@/views/report/questionList'),
                        meta: { title: '口腔问题', icon: 'form', menuNo: 20802, parentId: 20802 },
                    },
                    {
                        path: '/report/question/add',
                        name: 'questionAdd',
                        hidden: true,
                        component: () => import('@/views/report/questionAdd'),
                        meta: { title: '新增口腔问题', icon: 'form'},
                    },
                ]
            },
            {
                path: '/report/plan',
                name: 'planionIndex',
                component: () => import('@/views/report/index'),
                meta: { title: '治疗方案', icon: 'form', menuNo: 20803, parentId: 208 },
                redirect: '/report/plan/list',
                children: [
                    {
                        path: '/report/plan/list',
                        name: 'planList',
                        component: () => import('@/views/report/planList'),
                        meta: { title: '治疗方案', icon: 'form', menuNo: 20803, parentId: 20803 },
                    },
                    {
                        path: '/report/plan/add',
                        name: 'planAdd',
                        hidden: true,
                        component: () => import('@/views/report/planAdd'),
                        meta: { title: '新增治疗方案', icon: 'form' },
                    },
                ]
            },
        ]
    },
    {
        path: '/consumer',
        component: Layout,
        name: 'consumer',
        meta: { title: '用户', icon: 'consumer', menuNo: 508 },
        children: [
            {
                path: '/consumer/index',
                name: 'consumerIndex',
                component: () => import('@/views/consumer/index'),
                meta: { title: '平台用户', icon: 'form', menuNo: 50801, parentId: 508 },
            },
            {
                path: '/consumer/review',
                name: 'consumerReview',
                component: () => import('@/views/consumer/wrap'),
                meta: { title: '用户评论', icon: 'form', menuNo: 50802, parentId: 508 },
                redirect: '/consumer/review/list',
                children: [
                    {
                        path: '/consumer/review/list',
                        name: 'consumerReviewList',
                        component: () => import('@/views/consumer/review'),
                        meta: { title: '用户评论', icon: 'form' },
                        hidden: true
                    },
                    {
                        path: '/consumer/review/add',
                        name: 'consumerReviewAdd',
                        component: () => import('@/views/consumer/addReview'),
                        meta: { title: '新增用户评论', icon: 'form' },
                        hidden: true
                    }
                ]
            },
            {
                path: '/consumer/price',
                name: 'consumerPrice',
                component: () => import('@/views/consumer/price'),
                meta: { title: '查询价格', icon: 'form', menuNo: 50803, parentId: 508 },
            },
            {
                path: '/consumer/online',
                name: 'consumerOnline',
                component: () => import('@/views/consumer/online'),
                meta: { title: '在线预约', icon: 'form', menuNo: 50804, parentId: 508 },
            },
            {
                path: '/consumer/apply',
                name: 'consumerApply',
                component: () => import('@/views/consumer/apply'),
                meta: { title: '申请报告', icon: 'form', menuNo: 50805, parentId: 508 },
            },
            {
                path: '/consumer/enter',
                name: 'consumerEnter',
                component: () => import('@/views/consumer/enter'),
                meta: { title: '机构入驻', icon: 'form', menuNo: 50806, parentId: 508 },
            },
        ],
    },
    {
        path: '/information',
        component: Layout,
        name: 'information',
        meta: { title: '资料', icon: 'information', menuNo: 608 },
        children: [
            {
                path: '/information/oral',
                name: 'informationIndex',
                component: () => import('@/views/information/index'),
                meta: { title: '口腔百科', icon: 'form', menuNo: 60801, parentId: 608 },
                redirect: '/information/oral/list',
                children: [
                    {
                        path: '/information/oral/list',
                        name: 'informationOralList',
                        component: () => import('@/views/information/oral'),
                        meta: { title: '口腔百科', icon: 'form' },
                        hidden: true
                    },
                    {
                        path: '/information/oral/add',
                        name: 'informationOralAdd',
                        component: () => import('@/views/information/addOral'),
                        meta: { title: '新增百科', icon: 'form' },
                        hidden: true
                    }
                ]
            },
            {
                path: '/information/case',
                name: 'informationCase',
                component: () => import('@/views/information/index'),
                meta: { title: '口腔案例', icon: 'form', menuNo: 60807, parentId: 608 },
                redirect: '/information/case/list',
                children: [
                    {
                        path: '/information/case/list',
                        name: 'informationCaseList',
                        component: () => import('@/views/information/case'),
                        meta: { title: '口腔案例', icon: 'form' },
                        hidden: true
                    },
                    {
                        path: '/information/case/add',
                        name: 'informationCaseAdd',
                        component: () => import('@/views/information/addCase'),
                        meta: { title: '新增案例', icon: 'form' },
                        hidden: true
                    }
                ]
            },
            {
                path: '/information/news',
                name: 'informationNews',
                component: () => import('@/views/information/index'),
                meta: { title: '文章资讯', icon: 'form', menuNo: 60802, parentId: 608 },
                redirect: '/information/news/list',
                children: [
                    {
                        path: '/information/news/list',
                        name: 'informationNewsList',
                        component: () => import('@/views/information/news'),
                        meta: { title: '文章资讯', icon: 'form' },
                        hidden: true
                    },
                    {
                        path: '/information/news/add',
                        name: 'informationNewsAdd',
                        component: () => import('@/views/information/addNews'),
                        meta: { title: '新增文章', icon: 'form' },
                        hidden: true
                    }
                ]
            },
            {
                path: '/information/answer',
                name: 'informationAnswer',
                component: () => import('@/views/information/index'),
                meta: { title: '社区问答', icon: 'form', menuNo: 60803, parentId: 608 },
                redirect: '/information/answer/list',
                children: [
                    {
                        path: '/information/answer/list',
                        name: 'informationAnswerList',
                        component: () => import('@/views/information/answer'),
                        meta: { title: '社区问答', icon: 'form' },
                        hidden: true
                    },
                    {
                        path: '/information/answer/add',
                        name: 'informationAnswerAdd',
                        component: () => import('@/views/information/addAnswer'),
                        meta: { title: '新增问答', icon: 'form' },
                        hidden: true
                    }
                ]
            },
            {
                path: '/information/hospital',
                name: 'informationHospital',
                component: () => import('@/views/information/index'),
                meta: { title: '医院资质', icon: 'form', menuNo: 60804, parentId: 608 },
                redirect: '/information/hospital/list',
                children: [
                    {
                        path: '/information/hospital/list',
                        name: 'informationHospitalList',
                        component: () => import('@/views/information/hospital'),
                        meta: { title: '医院资质', icon: 'form' },
                        hidden: true
                    },
                    {
                        path: '/information/hospital/add',
                        name: 'informationHospitalAdd',
                        component: () => import('@/views/information/addHospital'),
                        meta: { title: '新增医院', icon: 'form' },
                        hidden: true
                    }
                ]
            },
            {
                path: '/information/doctor',
                name: 'informationDoctor',
                component: () => import('@/views/information/index'),
                meta: { title: '医生资质', icon: 'form', menuNo: 60805, parentId: 608 },
                redirect: '/information/doctor/list',
                children: [
                    {
                        path: '/information/doctor/list',
                        name: 'informationDoctorList',
                        component: () => import('@/views/information/doctor'),
                        meta: { title: '医生资质', icon: 'form' },
                        hidden: true
                    },
                    {
                        path: '/information/doctor/add',
                        name: 'informationDoctorAdd',
                        component: () => import('@/views/information/addDoctor'),
                        meta: { title: '新增医生', icon: 'form' },
                        hidden: true
                    }
                ]
            },
            {
                path: '/information/material',
                name: 'informationMaterial',
                component: () => import('@/views/information/index'),
                meta: { title: '材料资质', icon: 'form', menuNo: 60806, parentId: 608 },
                redirect: '/information/material/list',
                children: [
                    {
                        path: '/information/material/list',
                        name: 'informationMaterialList',
                        component: () => import('@/views/information/material'),
                        meta: { title: '材料资质', icon: 'form' },
                        hidden: true
                    },
                    {
                        path: '/information/material/add',
                        name: 'informationMaterialAdd',
                        component: () => import('@/views/information/addMaterial'),
                        meta: { title: '新增材料', icon: 'form' },
                        hidden: true
                    }
                ]
            },
        ],
    },
    {
        path: '/statistics',
        component: Layout,
        name: 'statistics',
        meta: { title: '数据', icon: 'statistics', menuNo: 107 },
        children: [
            {
                path: '/statistics/index',
                name: 'hospitalStatistics',
                component: () => import('@/views/statistics/index'),
                meta: { title: '医院统计', icon: 'form', menuNo: 10701, parentId: 107 },
            },
            {
                path: '/statistics/sale',
                name: 'saleStatistics',
                component: () => import('@/views/statistics/sale'),
                meta: { title: '销售统计', icon: 'form', menuNo: 10702, parentId: 107 },
            },
            {
                path: '/statistics/ad',
                name: 'adStatistics',
                component: () => import('@/views/statistics/ad'),
                meta: { title: '广告统计', icon: 'form', menuNo: 10703, parentId: 107 },
            },
        ],
    },
    {
        path: '/finance',
        component: Layout,
        name: 'finance',
        meta: { title: '财务', icon: 'finance', menuNo: 308 },
        children: [
            {
                path: '/finance/book',
                name: 'financeBook',
                component: () => import('@/views/finance/book'),
                meta: { title: '预约处理', icon: 'form', menuNo: 30801, parentId: 308 },
            },
            {
                path: '/finance/details',
                name: 'financeDetails',
                component: () => import('@/views/finance/details'),
                meta: { title: '结算明细', icon: 'form', menuNo: 30802, parentId: 308 },
            },
            {
                path: '/finance/records',
                name: 'financeRecords',
                component: () => import('@/views/finance/records'),
                meta: { title: '账单记录', icon: 'form', menuNo: 30803, parentId: 308 },
            },
            {
                path: '/finance/overview',
                name: 'financeOverview',
                component: () => import('@/views/finance/overview'),
                meta: { title: '结算总览', icon: 'form', menuNo: 30804, parentId: 308 },
            },
            {
                path: '/finance/contrast',
                name: 'financeContrast',
                component: () => import('@/views/finance/contrast'),
                meta: { title: '数据对照', icon: 'form', menuNo: 30805, parentId: 308 },
            },
        ],
    },
    {
        path: '/configuration',
        component: Layout,
        name: 'configuration',
        meta: { title: '配置', icon: 'configuration', menuNo: 708 },
        children: [
            {
                path: '/configuration/hospital',
                name: 'configurationHospital',
                component: () => import('@/views/configuration/hospital'),
                meta: { title: '医院类型', icon: 'form', menuNo: 70801, parentId: 708 },
            },
            {
                path: '/configuration/doctor',
                name: 'configurationDoctor',
                component: () => import('@/views/configuration/doctor'),
                meta: { title: '医生职称', icon: 'form', menuNo: 70802, parentId: 708 },
            },
            {
                path: '/configuration/project',
                name: 'configurationProject',
                component: () => import('@/views/configuration/project'),
                meta: { title: '口腔项目', icon: 'form', menuNo: 70803, parentId: 708 },
            },
            {
                path: '/configuration/question',
                name: 'configurationQuestion',
                component: () => import('@/views/configuration/question'),
                meta: { title: '口腔问题', icon: 'form', menuNo: 70804, parentId: 708 },
            },
            {
                path: '/configuration/service',
                name: 'configurationService',
                component: () => import('@/views/configuration/service'),
                meta: { title: '特色服务', icon: 'form', menuNo: 70805, parentId: 708 },
            },
            {
                path: '/configuration/label',
                name: 'configurationLabel',
                component: () => import('@/views/configuration/label'),
                meta: { title: '特色标签', icon: 'form', menuNo: 70806, parentId: 708 },
            },
            {
                path: '/configuration/news',
                name: 'configurationNews',
                component: () => import('@/views/configuration/news'),
                meta: { title: '文章分类', icon: 'form', menuNo: 70807, parentId: 708 },
            },
            {
                path: '/configuration/city',
                name: 'configurationCity',
                component: () => import('@/views/configuration/city'),
                meta: { title: '城市管理', icon: 'form', menuNo: 70808, parentId: 708 },
            },
            {
                path: '/configuration/source',
                name: 'configurationSource',
                component: () => import('@/views/configuration/source'),
                meta: { title: '用户来源', icon: 'form', menuNo: 70809, parentId: 708 },
            },
            {
                path: '/configuration/ad',
                name: 'configurationAd',
                component: () => import('@/views/configuration/ad'),
                meta: { title: '广告代号', icon: 'form', menuNo: 70810, parentId: 708 },
            },
        ],
    },
    {
        path: '/inquire',
        component: Layout,
        name: 'inquire',
        meta: { title: '查询', icon: 'statistics', menuNo: 808 },
        children: [
            {
                path: '/inquire/index',
                name: 'inquireBook',
                component: () => import('@/views/inquire/book'),
                meta: { title: '预约查询', icon: 'form', menuNo: 80801, parentId: 808 },
            },
            {
                path: '/inquire/settle',
                name: 'inquireSettle',
                component: () => import('@/views/inquire/settle'),
                meta: { title: '结算查询', icon: 'form', menuNo: 80802, parentId: 808 },
            },
            {
                path: '/inquire/consult',
                name: 'inquireConsult',
                component: () => import('@/views/inquire/consult'),
                meta: { title: '咨询查询', icon: 'form', menuNo: 80803, parentId: 808 },
            },
        ],
    },
    {
        path: '/system',
        component: Layout,
        meta: { title: '系统', icon: 'system', menuNo: 108 },
        children: [
            {
                path: '/system/todo',
                name: 'system.todo',
                component: () => import('@/views/system/todo'),
                meta: {
                    title: '待办通知',
                    icon: 'el-icon-user',
                    menuNo: 10801,
                    parentId: 108,
                },
            },
            {
                path: '/system/visitRecord',
                name: 'system.visitRecord',
                component: () => import('@/views/system/visitRecord'),
                meta: {
                    title: '回访记录',
                    icon: 'el-icon-user',
                    menuNo: 10802,
                    parentId: 108,
                },
            },
            {
                path: '/system/message',
                name: 'system.message',
                component: () => import('@/views/system/msg'),
                meta: {
                    title: '短信记录',
                    icon: 'el-icon-user',
                    menuNo: 10803,
                    parentId: 108,
                },
            },
            {
                path: '/system/remind',
                name: 'system.remind',
                component: () => import('@/views/system/remind'),
                meta: {
                    title: '提醒记录',
                    icon: 'el-icon-user',
                    menuNo: 108018,
                    parentId: 108,
                },
            },
            {
                path: '/system/collection',
                name: 'system.collection',
                component: () => import('@/views/system/collection'),
                meta: {
                    title: '收款改动',
                    icon: 'el-icon-user',
                    menuNo: 108017,
                    parentId: 108,
                },
            },
            {
                path: '/system/advertising',
                name: 'system.advertising',
                component: () => import('@/views/system/advertising'),
                meta: {
                    title: '广告管理',
                    icon: 'el-icon-user',
                    menuNo: 10810,
                    parentId: 108,
                },
            },
            // {
            //     path: '/system/source',
            //     name: 'system.source',
            //     component: () => import('@/views/system/source'),
            //     meta: {
            //         title: '来源配置',
            //         icon: 'el-icon-user',
            //         menuNo: 108012,
            //         parentId: 108,
            //     },
            // },
            {
                path: '/system/follow',
                name: 'system.follow',
                component: () => import('@/views/system/follow'),
                meta: {
                    title: '跟进配置',
                    icon: 'el-icon-user',
                    menuNo: 108016,
                    parentId: 108,
                },
            },
            // {
            //     path: '/system/ad',
            //     name: 'system.ad',
            //     component: () => import('@/views/system/ad'),
            //     meta: {
            //         title: '广告代号',
            //         icon: 'el-icon-user',
            //         menuNo: 10804,
            //         parentId: 108,
            //     },
            // },
            // {
            //     path: '/system/project',
            //     name: 'system.project',
            //     component: () => import('@/views/system/project'),
            //     meta: {
            //         title: '项目配置',
            //         icon: 'el-icon-user',
            //         menuNo: 108013,
            //         parentId: 108,
            //     },
            // },
            {
                path: '/system/city',
                name: 'system.city',
                component: () => import('@/views/system/city'),
                meta: {
                    title: '城市配置',
                    icon: 'el-icon-user',
                    menuNo: 108014,
                    parentId: 108,
                },
            },
            {
                path: '/system/user',
                name: 'systemuser',
                component: () => import('@/views/system/user'),
                meta: {
                    title: '用户管理',
                    icon: 'el-icon-user',
                    menuNo: 10808,
                    parentId: 108,
                },
            },
            {
                path: '/system/department',
                name: 'department',
                component: () => import('@/views/system/department'),
                meta: {
                    title: '部门管理',
                    icon: 'el-icon-office-building',
                    menuNo: 10809,
                    parentId: 108,
                },
            },
            {
                path: '/system/menu',
                name: 'menu',
                component: () => import('@/views/system/menu'),
                meta: {
                    title: '菜单管理',
                    icon: 'el-icon-connection',
                    menuNo: 10806,
                    parentId: 108,
                },
            },
            // {
            //   path: 'permissions',
            //   name: 'permissions',
            //   component: () => import('@/views/system/permissions'),
            //   meta: { title: '权限管理', icon: 'el-icon-connection', menuNo: 10104 }
            // },
            {
                path: '/system/role',
                name: 'role',
                component: () => import('@/views/system/role'),
                meta: { title: '角色管理', icon: 'form', menuNo: 10807, parentId: 108 },
            },
            {
                path: '/system/seo',
                name: 'system.seo',
                component: () => import('@/views/system/seo'),
                meta: {
                    title: 'seo管理',
                    icon: 'el-icon-user',
                    menuNo: 10811,
                    parentId: 108,
                },
            },
            {
                path: '/system/log',
                name: 'systemLog',
                component: () => import('@/views/system/log'),
                meta: { title: '日志管理', icon: 'form', menuNo: 108011, parentId: 108 },
            },
            {
                path: '/system/password',
                name: 'systemPassword',
                component: () => import('@/views/system/password'),
                meta: { title: '修改密码', icon: 'form', menuNo: 108015, parentId: 108 },
            },
        ],
    },

    { path: '*', redirect: '/404', hidden: true },
]

const createRouter = () =>
    new Router({
        // mode: 'history', // require service support
        scrollBehavior: () => ({ y: 0 }),
        routes: constantRoutes,
    })

const router = createRouter()

// Detail see: https://github.com/vuejs/vue-router/issues/1234#issuecomment-357941465
export function resetRouter() {
    const newRouter = createRouter()
    router.matcher = newRouter.matcher // reset router
}

export default router
